home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / pascal / pull20.zip / PULLVARS.PAS < prev    next >
Pascal/Delphi Source File  |  1988-01-11  |  7KB  |  174 lines

  1. { =========================================================================== }
  2. { PullVars.pas - Variables for Multi-level pull-down menus. ver 2.0, 01-12-87 }
  3. {                                                                             }
  4. { This file contains all the variables needed for PULL20.TPU.  You cannot     }
  5. { change this file unless you have the complete PULL20.PAS source code.       }
  6. { =========================================================================== }
  7.  
  8. {$R-,S-,I-,D-,T-,F-,V-,B-,N-,L+ }
  9.  
  10. UNIT PullVars;
  11.  
  12. INTERFACE
  13.  
  14. uses WndwVars;
  15.  
  16. const
  17.   MaxMenuLines     = 15;     { For Main and Sub menus }
  18.   MaxCharsPerLine  = 20;     { For Main and Sub menus and Data Windows }
  19.   MaxStringLength  = 80;     { Screen limit }
  20.   LastMainMenu     =  8;     { 1 - 255 }
  21.   NumOfMainMenus   =  8;     { 1 - 255 }
  22.   NumOfSubMenus    =  5;     { 1 - 255 }
  23.   NumOfDataWndws   = 12;     { 1 - 255 }
  24.   NumOfHelpWndws   = 14;     { 1 - 255 }
  25.   NumOfMsgLines    = 11;     { 1 - 255 }
  26.   NumOfErrMsgLines =  8;     { 1 - 65535 }
  27.   MaxErrStrLength  = 60;     { Error messages are usually shorter }
  28.   TotalHelpLines   = 81;     { 1 - 65535 }
  29.   HelpCharsPerLine = 50;     { 1 - Screen limit }
  30.  
  31. type
  32.   LineModeType   = (Choice, ExecOnly, Comment, Partition,
  33.                     ToDataWndw, ToSubMenu, ToUserWndw);
  34.   MenuModeType   = (ExecChoice, ExecSingleChoice, ExecMultipleChoice,
  35.                     SingleChoice, MultipleChoice);
  36.   TypeOfDataType = (Bytes,Words,Integers,LongInts,Reals,UserNums,Chars,
  37.                     Strings,UserStrings);
  38.   Toggle         = (Off, On, No, Yes);
  39.   MaxString      = string[MaxStringLength];
  40.   ErrMsgString   = string[MaxErrStrLength];
  41.   MenuRec = record
  42.               Title:        string[MaxCharsPerLine];
  43.               CmdLtrs:      string[MaxMenuLines];
  44.               Line:         array[1..MaxMenuLines] of string[MaxCharsPerLine];
  45.               LineMode:     array[1..MaxMenuLines] of LineModeType;
  46.               Flagged:      array[1..MaxMenuLines] of boolean;
  47.               LinkNum:      array[1..MaxMenuLines] of byte;
  48.               LinkDir:      DirType;
  49.               MenuMode:     MenuModeType;
  50.               MenuLines:    byte;
  51.               NameCol:      byte;
  52.               Row, Col, Rows, Cols:                    byte;
  53.               DefaultLine, HiLiteLine, SingleFlagLine: byte;
  54.               Battr, Wattr, Hattr, Lattr, Cattr:       byte;
  55.               Border:                                  Borders;
  56.               BackToDefault, Changed:                  boolean;
  57.               MsgLineNum, HelpWndwNum:                 byte;
  58.             end;
  59.   DataWndwRec = record
  60.               Line: array[1..2] of string[MaxCharsPerLine];
  61.               TypeOfData:               TypeOfDataType;
  62.               Row, Col, Rows, Cols:     byte;
  63.               RowAlt, ColAlt:           byte;
  64.               FirstCol, Field:          byte;
  65.               Decimals:                 integer;
  66.               Justify:                  DirType;
  67.               Battr, Wattr, Hattr:      byte;
  68.               Border:                   Borders;
  69.               MsgLineNum, HelpWndwNum:  byte;
  70.             end;
  71.   HelpWndwRec = record
  72.               FirstLine, LastLine:      byte;
  73.               LinesToShow:              byte;
  74.               Row, Col, Rows, Cols:     byte;
  75.               Battr, Wattr:             byte;
  76.               Border:                   Borders;
  77.               HWmodes:                  byte;
  78.               MsgLineNum:               byte
  79.             end;
  80.   DwordPtr = ^longint;
  81.  
  82. const
  83.   HelpKey = #59;    { F1 }   { Set equal to #00 if Help access is not wanted. }
  84.   PopKey  = #60;    { F2 }
  85.   TopKey1 = #68;    { F10 }  { Extended function key }
  86.   TopKey2 = #47;    { '/' }
  87.   EscKey  = #27;    { ^[ }
  88.   RetKey  = #13;    { ^M }
  89.   NullKey = #00;    { null }
  90.   HideCursor = $2000;        { CursorMode to hide the cursor. }
  91.   InWorkWndw:      boolean = true;
  92.   Quit:            boolean = false;
  93.   WaitForKbd:      boolean = true;
  94.   EnableKeyStatus: boolean = true;
  95.   CurrentMsgLineNum: word  = 0;   { Index of the message currently shown. }
  96.  
  97. var
  98.   MainMenu:     array[1..NumOfMainMenus] of MenuRec;
  99.   SubMenu:      array[1..NumOfSubMenus]  of MenuRec;
  100.   DataWndw:     array[1..NumOfDataWndws] of DataWndwRec;
  101.   HelpWndw:     array[1..NumOfHelpWndws] of HelpWndwRec;
  102.   HelpLine:     array[1..TotalHelpLines] of string[HelpCharsPerLine];
  103.   MsgLine:      array[1..NumOfMsgLines]  of MaxString;
  104.   ErrMsgLine:   array[1..NumOfErrMsgLines] of ErrMsgString;
  105.   TopMenuRecPtr: ^MenuRec;   { Points to the current Menu record }
  106.  
  107.   TopMenuRow,    MainMenuRow,
  108.   InitAttr,      StatusAttr,
  109.   TopMenuAttr,   TopMenuHattr,  TopMenuLattr,  MsgLineAttr,   KeyStatusAttr,
  110.   MainMenuWattr, MainMenuBattr, MainMenuHattr, MainMenuLattr, MainMenuCattr,
  111.   SubMenuWattr,  SubMenuBattr,  SubMenuHattr,  SubMenuLattr,  SubMenuCattr,
  112.   HelpWndwWattr, HelpWndwBattr: byte;
  113.   MainMenuBrdr,  SubMenuBrdr,  HelpWndwBrdr: Borders;
  114.   HelpWndwModes:  byte;
  115.   HelpMsgLineNum: word;
  116.  
  117.   TopCmdLtrs:        string[NumOfMainMenus];
  118.   CmdSeq,MoreCmdSeq: string[MaxWndw];   { Sequence of keys pressed. }
  119.   RowsBelowHelp,RowsBelowMsg: byte;
  120.  
  121.   MPulled, SPulled, HiLited: byte;
  122.   TopMenuStr:       MaxString;
  123.   ExtKey,
  124.   LocationWarning:  boolean;
  125.   Key:              char;
  126.   CapsLockCol:      byte;
  127.  
  128.   { Controls to Pull/Pop the menus. }
  129.   PullDown, Pop:    boolean;
  130.   PopLevels:        byte;
  131.   PopToWorkWndw, PopToTop, PopAndProcess,
  132.   AccessedWorkWndw, AccessedMenus: boolean;
  133.   WorkWndwStep:     word;
  134.  
  135.   { These are addresses for the indirect forward calls out of PULL.TPU }
  136.   AddrGetUserPullStats,  AddrGetOverrideStats,
  137.   AddrProcess,           AddrWorkWndw,
  138.   AddrDataTransfer,      AddrCheckGlobalKeys:  DwordPtr;
  139.  
  140. { Variables for Data Entry procedures }
  141. type
  142.   DataPadRec = record
  143.               StoreMode,Valid,DataStored,NewData: boolean;
  144.               case TypeOfData: TypeOfDataType of
  145.                 Bytes:        (Bdata:  byte);
  146.                 Words:        (Wdata:  word);
  147.                 Integers:     (Idata:  integer);
  148.                 LongInts:     (Ldata:  longint);
  149.                 Reals:        (Rdata:  real);
  150.                 UserNums:     (UNdata: MaxString);
  151.                 Chars:        (Cdata:  char);
  152.                 Strings:      (Sdata:  MaxString);
  153.                 UserStrings:  (USdata: MaxString);
  154.             end;
  155.  
  156. var
  157.   DataPad:      DataPadRec;
  158.   DataWndwWattr, DataWndwBattr: byte;
  159.   DataWndwBrdr: Borders;
  160.   AutoNumLock:  boolean;
  161.   DataEntryStr: MaxString;  { Global variable for Work window (not affected by
  162.                               DataWndw entries). }
  163.   UserCharSet: set of char;
  164.  
  165. const
  166.   DelKey = #83;
  167.   BSKey  = #08;
  168.  
  169. IMPLEMENTATION
  170.  
  171. BEGIN
  172.   DataPad.NewData:=true;
  173. END.
  174.